# 加载代码
path = File.dirname(__FILE__).force_encoding('utf-8')
files = [
 File.join(path, 'chen_RebarTools/straightRebar.rb'),
 File.join(path, 'chen_RebarTools/elbowRebar.rb'),
 File.join(path, 'chen_RebarTools/oneBtnPillarPosition.rb'),
 File.join(path, 'chen_RebarTools/oneBtnRectPillar.rb'),
 File.join(path, 'chen_RebarTools/oneBtnPillarMainRF.rb'),
 File.join(path, 'chen_RebarTools/oneBtnPillarStirrupRF.rb'),
 File.join(path, 'chen_RebarTools/oneBtnPillarRF.rb'),
 File.join(path, 'chen_RebarTools/oneBtnHookRF.rb'),
 File.join(path, 'chen_RebarTools/pillarClass.rb')
 #File.join(path, 'chen_RebarTools/cube.html')
]
files.each{|file|
 next unless File.file?(file)
 load file
}

# 新增工具条
menu = UI.menu('Extensions')
toolbar = UI::Toolbar.new "钢之术士工具条"


cmd = UI::Command.new("create_Pillar"){
    Pillar.create_Dialog
}
cmd.large_icon = cmd.small_icon = "chen_RebarTools/image/classPillar.png"
cmd.tooltip = "创建框架柱类"
cmd.status_bar_text = "这是创建框架柱类的插件"
toolbar.add_item cmd

cmd = UI::Command.new("create_straightRF"){
    #创建直线筋的插件
    create_straightRF
}
cmd.large_icon = cmd.small_icon = "chen_RebarTools/image/straightRebar.png"
cmd.tooltip = "创建直线筋"
cmd.status_bar_text = "这是创建直线筋的插件"
toolbar.add_item cmd



cmd = UI::Command.new("create_elbowRF"){
    #创建一头弯筋的插件
    create_elbowRF
}
cmd.large_icon = cmd.small_icon = "chen_RebarTools/image/elbowRebar.png"
cmd.tooltip = "创建一头弯筋"
cmd.status_bar_text = "这是创建一头弯筋的插件"
toolbar.add_item cmd


cmd = UI::Command.new("create_Rect_MainRF_Position"){
    #创建一头弯筋的插件
    create_Rect_MainRF_Position
}
cmd.large_icon = cmd.small_icon = "chen_RebarTools/image/oneBtnPillarPosition.png"
cmd.tooltip = "创建矩形柱主筋定位"
cmd.status_bar_text = "这是创建矩形柱主筋定位的插件"
toolbar.add_item cmd


cmd = UI::Command.new("create_Rect"){
    #创建矩形柱的插件
    create_Rect
}
cmd.large_icon = cmd.small_icon = "chen_RebarTools/image/oneBtnRectPillar.png"
cmd.tooltip = "创建矩形柱"
cmd.status_bar_text = "这是创建矩形柱的插件"
toolbar.add_item cmd

cmd = UI::Command.new("create_Rect_MainRF"){
    #创建矩形柱主筋的插件
    create_Rect_MainRF
}
cmd.large_icon = cmd.small_icon = "chen_RebarTools/image/oneBtnPillarMainRF.png"
cmd.tooltip = "创建矩形柱主筋"
cmd.status_bar_text = "这是创建矩形柱主筋的插件"
toolbar.add_item cmd

cmd = UI::Command.new("create_Rect_StirrupRF"){
    #创建矩形箍筋的插件
    create_Rect_StirrupRF
}
cmd.large_icon = cmd.small_icon = "chen_RebarTools/image/oneBtnStirrupRF.png"
cmd.tooltip = "创建矩形箍筋"
cmd.status_bar_text = "这是创建矩形箍筋的插件"
toolbar.add_item cmd



cmd = UI::Command.new("create_Rect_HookRF"){
    #创建钢筋拉钩的插件
    create_Rect_HookRF
}
cmd.large_icon = cmd.small_icon = "chen_RebarTools/image/oneBtnHookRF.png"
cmd.tooltip = "创建拉钩"
cmd.status_bar_text = "这是创建拉钩的插件"
toolbar.add_item cmd




cmd = UI::Command.new("create_Rect_RF"){
    #创建矩形柱配筋的插件
    create_Rect_RF
}
cmd.large_icon = cmd.small_icon = "chen_RebarTools/image/oneBtnPillarRF.png"
cmd.tooltip = "创建矩形柱配筋"
cmd.status_bar_text = "这是创建矩形柱配筋的插件"
toolbar.add_item cmd

toolbar.show
#menu.add_item cmd
